import { createApp } from 'vue'
import App from './App.vue'
import 'virtual:svg-icons-register';
import 'uno.css'
import 'element-plus/dist/index.css'
import "./permission";
import router from "./router";
import pinia from "./stores";
import "./styles/index.scss";
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import ElementPlus from 'element-plus'
import 'element-plus/theme-chalk/dark/css-vars.css'
import directives from "@/directives/index";
import i18n from './locales/i18n';
import '@/assets/font/font.scss'
import {errorHandler} from '@/utils/errorHandler'
import { zoomDetector } from '@/utils/zoomDetect';
import '@/styles/zoom.scss';
errorHandler.setupGlobalPromiseErrorHandler()
const app = createApp(App)
app.use(i18n);
app.use(ElementPlus, {
    locale: zhCn,
  })
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.use(router)
app.use(pinia)
app.use(directives)

// 初始化缩放检测
zoomDetector.init({ detectInterval: 500 });

app.mount('#app')


